package com.netease.pris.activity.a;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import com.netease.framework.k;
import com.netease.image.d;
import com.netease.pris.atom.g;
import com.netease.pris.atom.u;
import java.util.LinkedList;
import java.util.List;

public class ak extends BaseAdapter
{
  private int a;
  private LinkedList b;
  private Context c;
  private LayoutInflater d;

  public ak(Context paramContext)
  {
    this.c = paramContext;
    this.d = ((LayoutInflater)paramContext.getSystemService("layout_inflater"));
  }

  private void a(f paramf, View paramView)
  {
    try
    {
      paramf.a = ((ImageView)paramView.findViewById(2131558635));
      paramf.b = ((TextView)paramView.findViewById(2131558637));
      paramf.c = ((TextView)paramView.findViewById(2131558640));
      paramf.d = ((TextView)paramView.findViewById(2131558641));
      paramf.e = ((RatingBar)paramView.findViewById(2131558638));
      return;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
    }
    finally
    {
    }
    throw localObject;
  }

  private void a(f paramf, u paramu, int paramInt)
  {
    try
    {
      String str1 = paramu.b(g.g);
      if (str1 == null)
        str1 = paramu.b(g.f);
      paramf.a.setImageDrawable(k.a(this.c).b(2130837804));
      if (str1 != null)
      {
        StringBuilder localStringBuilder = new StringBuilder();
        paramf.a.setTag(localStringBuilder);
        d.a().a(localStringBuilder, 1, str1, new h(this, paramf), -1, -1, 2, this.a);
      }
      String str2 = paramu.U();
      if ((str2 != null) && (paramf.b != null))
        paramf.b.setText(str2);
      if (paramf.e != null)
      {
        paramf.e.setNumStars(paramu.ae());
        paramf.e.setRating((float)paramu.ah());
      }
      int i;
      if (paramf.c != null)
      {
        i = paramu.am();
        if (i <= 0)
          break label229;
      }
      while (true)
      {
        TextView localTextView = paramf.c;
        Context localContext = this.c;
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = Integer.valueOf(i);
        localTextView.setText(localContext.getString(2131361966, arrayOfObject));
        if (paramf.d != null)
          paramf.d.setText(paramu.ai());
        return;
        label229: i = 0;
      }
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
    }
    finally
    {
    }
    throw localObject;
  }

  public void a()
  {
    synchronized (this.b)
    {
      this.b.clear();
      notifyDataSetChanged();
      return;
    }
  }

  public void a(int paramInt)
  {
    this.a = paramInt;
  }

  public void a(LinkedList paramLinkedList)
  {
    this.b = paramLinkedList;
  }

  public void a(List paramList)
  {
    if ((paramList == null) || (paramList.size() == 0));
    while (true)
    {
      return;
      synchronized (this.b)
      {
        for (int i = -1 + paramList.size(); i >= 0; i--)
          this.b.addFirst(paramList.get(i));
        notifyDataSetChanged();
      }
    }
  }

  public u b(int paramInt)
  {
    if (this.b != null)
      if (paramInt >= this.b.size())
        paramInt = -1 + this.b.size();
    for (u localu = (u)this.b.get(paramInt); ; localu = null)
      return localu;
  }

  public void b(List paramList)
  {
    if ((paramList == null) || (paramList.size() == 0));
    while (true)
    {
      return;
      synchronized (this.b)
      {
        this.b.addAll(paramList);
        notifyDataSetChanged();
      }
    }
  }

  public int getCount()
  {
    int i = 0;
    if (this.b != null)
      i = this.b.size();
    return i;
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    f localf;
    if ((paramView != null) && ((paramView.getTag() instanceof f)))
      localf = (f)paramView.getTag();
    while (true)
    {
      u localu = b(paramInt);
      if (localu != null)
        a(localf, localu, paramInt);
      return paramView;
      paramView = this.d.inflate(2130903104, null);
      localf = new f(this);
      a(localf, paramView);
      paramView.setTag(localf);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.a.ak
 * JD-Core Version:    0.6.0
 */